home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue67 / construc / DrBob42_impl.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2001-01-31  |  2.0 KB  |  77 lines

  1. unit DrBob42_impl;
  2.  
  3. {This file was generated on 31 Jan 2001 11:22:44 GMT by version 03.03.03.C1.06}
  4. {of the Inprise VisiBroker idl2pas CORBA IDL compiler.                        }
  5.  
  6. {Please do not edit the contents of this file. You should instead edit and    }
  7. {recompile the original IDL which was located in the file                     }
  8. {D:\usr\bob\magazine\DELPHI.MAG\#67\src\drbob42.idl.                          }
  9.  
  10. {Delphi Pascal unit      : DrBob42_impl                                       }
  11. {derived from IDL module : DrBob42                                            }
  12.  
  13.  
  14. interface
  15. uses
  16.   SysUtils,
  17.   CORBA,
  18.   DrBob42_i,
  19.   DrBob42_c;
  20.  
  21. type
  22.   TAccounts = class;
  23.  
  24.   TAccounts = class(TInterfacedObject, DrBob42_i.Accounts)
  25.   protected
  26.   public
  27.     constructor Create;
  28.     procedure AccountArrayTest(const Accounts: DrBob42_i.AccountArray);
  29.     procedure AccountSequenceTest(const Accounts: DrBob42_i.AccountSequence);
  30.   end;
  31.  
  32.  
  33. implementation
  34. uses
  35.   Dialogs;
  36.  
  37. constructor TAccounts.Create;
  38. begin
  39.   inherited
  40. end;
  41.  
  42. procedure TAccounts.AccountArrayTest(const Accounts: DrBob42_i.AccountArray);
  43. var
  44.   i: Integer;
  45. begin
  46.   for i:=0 to 2 do
  47.   begin
  48.     if Accounts[i]._discriminator = normal then
  49.       ShowMessage(Format('Normal Balance %d: %1.2f',
  50.         [i+1,Accounts[i].accountN.balance]))
  51.     else
  52.       ShowMessage(Format('Savings Balance %d: %1.2f at %1.2f%%',
  53.         [i+1,Accounts[i].accountS.balance,
  54.          Accounts[i].accountS.rates.interest_rate]))
  55.   end
  56. end;
  57.  
  58. procedure TAccounts.AccountSequenceTest(const Accounts: DrBob42_i.AccountSequence);
  59. var
  60.   i: Integer;
  61. begin
  62.   for i:=0 to High(Accounts) do // use High on Open Array
  63.   begin
  64.     if Accounts[i]._discriminator = normal then
  65.       ShowMessage(Format('Normal Balance %d: %1.2f',
  66.         [i+1,Accounts[i].accountN.balance]))
  67.     else
  68.       ShowMessage(Format('Savings Balance %d: %1.2f at %1.2f%%',
  69.         [i+1,Accounts[i].accountS.balance,
  70.          Accounts[i].accountS.rates.interest_rate]))
  71.   end
  72. end;
  73.  
  74.  
  75. initialization
  76.  
  77. end.